<% this.title = contest.title + ' - 题目' %>
<% include header %>
<% include contest_header %>
<div class="row">
  <div class="column">
      <table class="ui selectable celled table">
        <thead>
          <tr>
            <th class="one wide" style="text-align: center">状态</th>
            <th>题目</th>
            <% if (hasStatistics) { %>
              <th class="one wide center aligned">统计</th>
            <% } %>
          </tr>
        </thead>
        <tbody>
          <%
          let i = 0;
          for (let problem of problems) {
            i++;
          %>
          <tr>
            <td class="center aligned" style="white-space: nowrap; ">
            <% if (problem.judge_id) { %>
              <a href="<%= syzoj.utils.makeUrl(['contest', 'submission', problem.judge_id]) %>">
              <% if (typeof problem.status === 'string') { %>
                <span class="status <%= problem.status.toLowerCase().split(' ').join('_') %>">
                  <b>
                  <i class="<%= icon[getStatusMeta(problem.status)] || 'remove' %> icon"></i>
                  <%= problem.feedback || problem.status %>
                  </b>
                </span>
              <% } else if (typeof problem.status === 'object') { %>
                <% if (problem.status.accepted) { %>
                  <span class="score score_10">
                    <% if (problem.status.unacceptedCount === 0) { %>
                      +
                    <% } else { %>
                      +<%= problem.status.unacceptedCount %>
                    <% } %>
                  </span>
                <% } else { %>
                  <span class="score score_0">
                    <% if (problem.status.unacceptedCount !== 0) { %>
                      -<%= problem.status.unacceptedCount %>
                    <% } %>
                  </span>
                <% } %>
              <% } %>
            <% } %>
            </td>
            <td><a href="<%= syzoj.utils.makeUrl(['contest', contest.id, 'problem', i]) %>"><%= syzoj.utils.removeTitleTag(problem.problem.title) %></a></td>
            <% if (hasStatistics) { %>
              <td class="center aligned" style="white-space: nowrap; ">
              <a href="<%= syzoj.utils.makeUrl(['contest', contest.id, 'submissions'], { problem_id: i, status: 'Accepted' }) %>"><%= problem.statistics.accepted %></a>
              /
                <a href="<%= syzoj.utils.makeUrl(['contest', contest.id, 'submissions'], { problem_id: i, min_score: 1 }) %>"><%= problem.statistics.partially %></a>
                <% if (contest.type === 'NOI' || contest.type === 'IOI') { %>
                /
              <% } %>
              <a href="<%= syzoj.utils.makeUrl(['contest', contest.id, 'submissions'], { problem_id: i }) %>"><%= problem.statistics.attempt %></a>
              </td>
            <% } %>
          </tr>
        <% } %>
        </tbody>
    </table>
  </div>
</div>
<% include contest_footer %>
<% include footer %>
